function validate_required(field,alerttxt)
{
with (field)
  {
    /*验证输入是否为空*/	
  if (field==null||value=="")
    {alert(alerttxt);return false}
  else {return true}
  }
}

function validate_form(thisform)
{
with (thisform)
  {
  	/*判断密码是否相等*/
   if(!(u_pass == u_repass)) 
   { 
   alert("前后输入密码不一致");
   u_repass.focus();
   return false; 
   } else{
   return true; 
   } 
  	/*判断输入是否为空*/
  if (validate_required(u_name,"用户名输入不能为空!")==false)
    {u_name.focus();return false}
    
  if (validate_required(u_qq,"QQ输入不能为空!")==false)
    {u_qq.focus();return false} 
    
  if (validate_required(u_email,"邮箱输入不能为空!")==false)
    {u_email.focus();return false} 
    
  if (validate_required(u_phone,"手机号输入不能为空!")==false)
    {u_phone.focus();return false} 
  }
}






































